package com.vrv.netmgr.alarm.detail;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageButton;
import android.widget.TextView;

import com.vrv.netmgr.R;
import com.vrv.netmgr.vo.SerializableNetFlowAbnormal;

/**
 * @Description 流量异常策略详细信息
 * @author yangzijian
 * @date
 * 
 */
public class DetailNetFlowAbnormalActivity extends Activity {
	//
	private SerializableNetFlowAbnormal info;
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
		setContentView(R.layout.detail_netflowabnormal);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.common_title);
		getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
		//
		initViews();
		setTitle();
	}
	//
	public void initViews(){
		//
		TextView unit = (TextView) findViewById(R.id.netflowabnormal_unit);
		TextView dep = (TextView) findViewById(R.id.netflowabnormal_dep);
		TextView user = (TextView) findViewById(R.id.netflowabnormal_user);
		TextView tel = (TextView) findViewById(R.id.netflowabnormal_tel);
		TextView ip = (TextView) findViewById(R.id.netflowabnormal_ip);
		TextView iip = (TextView) findViewById(R.id.netflowabnormal_iip);
		TextView mac = (TextView) findViewById(R.id.netflowabnormal_mac);
		TextView error = (TextView) findViewById(R.id.netflowabnormal_error);
		TextView login = (TextView) findViewById(R.id.netflowabnormal_login);
		TextView alarm = (TextView) findViewById(R.id.netflowabnormal_alarm);
		TextView check = (TextView) findViewById(R.id.netflowabnormal_check);
		//
		info = (SerializableNetFlowAbnormal) getIntent().getSerializableExtra("info");
		//
		unit.setText(info.getUNIT_NAME());
		dep.setText(info.getDEP_NAME());
		user.setText(info.getUSER_NAME());
		tel.setText(info.getTEL());
		ip.setText(info.getIP_ADDRESS());
		iip.setText(info.getVIOLATION_IP());
		mac.setText(info.getMAC_ADDRESS());
		error.setText(info.getALARM_DESC());
		login.setText(info.getLOGIN_USER());
		alarm.setText(info.getALARM_TIME());
		check.setText(info.getLOOK_FLAG());
	}
	public void setTitle() {
		TextView title = (TextView) findViewById(R.id.title_text);
		title.setText("流量异常"+"["+info.IP_ADDRESS+"]");

		/**
		 * 返回按钮
		 */
		ImageButton backBtn = (ImageButton) findViewById(R.id.backBtn);
		backBtn.setVisibility(View.VISIBLE);
		backBtn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
	}
	@Override
	public void onBackPressed() {
		finish();
		overridePendingTransition(R.anim.push_right_out, R.anim.push_right_in);
		super.onBackPressed();
	}
}
